/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package exercicio15;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 *
 * @author Caio
 */
public class Employees {
    private final List<Employee> employees = new ArrayList<>();
    
    public void Attach(Employee employee){
        employees.add(employee);
    }
    
    public void Detach(Employee employee){
        employees.remove(employee);
    }
    
    public void Accept(IVisitor visitor){
        for (Iterator<Employee> it = employees.iterator(); it.hasNext();) {
            Employee employee = it.next();
                employee.accept(visitor);
        }
        System.out.println("");
    }
}
